package com.mconnect.msurvey.model;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

@Entity
@Table(name = "responder_confirm")
public class ResponderConfirm implements Serializable{
	private static final long serialVersionUID = 1L;
	private int id_confirm;
	private Date arrivalDate;
	private String arrivalTime;
	private Responder id_responder;
	private int confirm_id_user;
	private java.util.Date confirmDate;
	private java.util.Date peselDate;
	private int pesel_id_user;
	private int numberOfRecommendConfirm;
	
	@Id
	@GeneratedValue
	public int getId_confirm() {
		return id_confirm;
	}
	public void setId_confirm(int id_confirm) {
		this.id_confirm = id_confirm;
	}
	
	@OneToOne(targetEntity=Responder.class, cascade = CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinColumn(name = "id_responder", referencedColumnName="id_responder" )
	@Fetch(FetchMode.SELECT)
	public Responder getId_responder() {
		return id_responder;
	}
	public void setId_responder(Responder id_responder) {
		this.id_responder = id_responder;
	}
	public Date getArrivalDate() {
		return arrivalDate;
	}
	public void setArrivalDate(Date arrivalDate) {
		this.arrivalDate = arrivalDate;
	}
	@Column(length=10)
	public String getArrivalTime() {
		return arrivalTime;
	}
	public void setArrivalTime(String arrivalTime) {
		this.arrivalTime = arrivalTime;
	}
	public int getConfirm_id_user() {
		return confirm_id_user;
	}
	public void setConfirm_id_user(int confirm_id_user) {
		this.confirm_id_user = confirm_id_user;
	}
	public int getPesel_id_user() {
		return pesel_id_user;
	}
	public void setPesel_id_user(int pesel_id_user) {
		this.pesel_id_user = pesel_id_user;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public java.util.Date getConfirmDate() {
		return confirmDate;
	}
	public void setConfirmDate(java.util.Date confirmDate) {
		this.confirmDate = confirmDate;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public java.util.Date getPeselDate() {
		return peselDate;
	}
	public void setPeselDate(java.util.Date peselDate) {
		this.peselDate = peselDate;
	}
	public int getNumberOfRecommendConfirm() {
		return numberOfRecommendConfirm;
	}
	public void setNumberOfRecommendConfirm(int numberOfRecommendConfirm) {
		this.numberOfRecommendConfirm = numberOfRecommendConfirm;
	}
}
